package controller;

import dao.UserDAO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
public class UserController {
    //模拟用户登录
//    @RequestMapping("login.html")
//    public ModelAndView login(Integer userId, HttpSession session) {
//        UserDAO userDAO = new UserDAO();
//        List<String> menus = userDAO.getUserMenu(userId);
//        session.setAttribute("user", userId);
//        session.setAttribute("menus", menus);
//        return new ModelAndView("index.jsp");
//    }

    @RequestMapping("add.html")
    public String add() {
        return "add.jsp";
    }

    @RequestMapping("del.html")
    public String del() {
        return "del.jsp";
    }

    @RequestMapping("get.html")
    public String get() {
        return "get.jsp";
    }

    @RequestMapping("error.html")
    public String error() {
        return "error.jsp";
    }
}
